from django.db import models

# Create your models here.
class Denglu(models.Model):
    username = models.CharField(max_length=20)
    password = models.CharField(max_length=20)
    class Meta:
        db_table = 'denglu'
class Dianpu(models.Model):
    name = models.CharField(max_length=20)
    class Meta:
        db_table = 'dianpu'
class Shangpin(models.Model):
    name = models.CharField(max_length=20)
    price = models.DecimalField(max_digits=7,decimal_places=2)
    pic = models.ImageField(null=True)
    cate = models.ForeignKey(Dianpu,on_delete=models.CASCADE)
    class Meta:
        db_table = 'shangpin'



